package com.example.Transactional;

import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @Description TODO
 * @Date 2024/6/2 20:14
 * @Created by houjunfeng
 */
public class TransactionalTest {

    @Test
    public void  test(){
        AnnotationConfigApplicationContext annotationConfigApplicationContext = new AnnotationConfigApplicationContext(TransactionalConfiguration.class);

        String[] students = annotationConfigApplicationContext.getBeanDefinitionNames();
        for(String s:students){
            System.out.println(s);
        }

        ResourceService resourceService = annotationConfigApplicationContext.getBean(ResourceService.class);
        resourceService.insertGoods();
        annotationConfigApplicationContext.close();
    }

}
